#!/usr/bin/bash
###
 # @Author: jackning 270580156@qq.com
 # @Date: 2024-08-07 21:01:08
 # @LastEditors: jackning 270580156@qq.com
 # @LastEditTime: 2024-11-30 12:11:27
 # @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
 #   Please be aware of the BSL license restrictions before installing Bytedesk IM – 
 #  selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license. 
 #  仅支持企业内部员工自用，严禁私自用于销售、二次销售或者部署SaaS方式销售 
 #  Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE 
 #  contact: 270580156@qq.com 
 # 联系：270580156@qq.com
 # Copyright (c) 2024 by bytedesk.com, All Rights Reserved. 
### 

# 发布到Mac App Store
# https://www.electron.build/code-signing
# sh cicd/scripts/build-mac-mas.sh
# 
# security find-identity -v
# security find-identity -v -p codesigning
# 设置环境变量
# 
export APP_BUNDLE_ID=com.kefux.im
export APPLE_ID=270580156@qq.com
export APPLE_APP_SPECIFIC_PASSWORD=nltb-wfuw-fbpq-ydxk
export APPLE_TEAM_ID=L5F47963M2
# 
export CSC_LINK=./build/app-distribution.p12
export CSC_KEY_PASSWORD=weiyuai.cn
export CSC_INSTALLER_LINK=./build/3d-mac-installer.p12
export CSC_INSTALLER_KEY_PASSWORD=weiyuai.cn
# 
# 打印环境变量
# echo "CSC_LINK: $CSC_LINK"
# 清理缓存
# rm -rf /Users/ningjinpeng/Library/Caches/electron
# rm -rf /Users/ningjinpeng/Library/Caches/electron-builder

# 运行构建命令
pnpm build:mac:mas

# echo "build mac:mas success"
